package com.usian.article.client;

import com.usian.model.article.dtos.AuthorDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("leadnews-article")
public interface ArticleFeign {

    /**
     * 根据apUserid 查询作者信息
     * @param apUserId
     * @return
     */
    @GetMapping("/api/v1/author/findByUserId/{id}")
    public AuthorDto findByApUserId(@PathVariable(name = "id") Integer apUserId);

    /**
     * 保存作者
     *
     * @param authorDto
     * @return id
     */
    @PostMapping("/api/v1/author/save")
    public Integer save(@RequestBody AuthorDto authorDto);
}
